mudbox::Light Class Reference

#include <light.h>

Inheritance diagram for mudbox::Light:

Inheritance graph
[legend]
List of all members.

Detailed Description

Represents a light source in the scene.

Public Types

enum   LightType {
  LIGHT_DIRECTIONAL = 0, LIGHT_POINT, LIGHT_SPOT, LIGHT_IBL,
  LIGHT_NONE
}

Public Member Functions

virtual const mudbox::ClassDesc RuntimeClass (void) const
virtual Color  Diffuse (void) const
  Returns the diffuse color value of the light.
virtual void  SetDiffuse (const Color &cDiffuse)
  Sets the diffuse color value of the light.
virtual float  Intensity (void) const
  Returns the light intensity in range 0..1.
virtual void  SetIntensity (float fIntensity)
  Sets the light intensity in range 0..1.
virtual bool  IsLockedToCamera (void) const
  Returns true if the light direction is locked to the camera direction.
virtual void  SetLockedToCamera (bool bOnOrOff)
  Set lock/unlock to camera.
virtual bool  Render (void)
  Renders the light manipulator or light geometry, if they are turned on.
virtual Manipulator *  GetManipulator ()
  Returns a pointer to the light's manipulator, or NULL if no manipulator has been created.
virtual void  ValidateShadowMap ()
  Checks and updates the shadow map (if shadowing is turned on).
virtual Texture ShadowDepthMap ()
  Returns the depth map associated with the light.
virtual const Matrix ShadowMatrix () const
  Returns the shadow/depth map matrix associated with light.
virtual bool  CastShadow ()
  Returns true if shadow castinging is enabled for this light.
virtual float  ShadowBias ()
  Returns the shadow bias for this light.
virtual LightType  Type ()
  Returns the type of this light.
virtual void  SetAttenuation (float)
  Sets the light attenuation value. Range is from 0-1.
virtual float  Attenuation (void) const
  Returns the light attenuation value.
virtual Matrix  LockedToCameraMatrix () const
  Returns the "locked to camera" matrix.
virtual Image HDRImage () const
  Returns the HDRI image associated with this light, if any. Returns a NULL pointer if this is not an HDRI light.
virtual const QString *  HDRImageFilename () const

Static Public Member Functions

const mudbox::ClassDesc StaticClass (void)
mudbox::Node CreateInstances (unsigned int iCount=1)

Protected Member Functions

  Light (void)
  Constructor. Do not use this directly. Use CreateInstances() instead.

Member Enumeration Documentation

enum mudbox::Light::LightType
 
Enumeration values:
LIGHT_DIRECTIONAL 
LIGHT_POINT 
LIGHT_SPOT 
LIGHT_IBL 
LIGHT_NONE 
00037     {
00038         LIGHT_DIRECTIONAL=0,
00039         LIGHT_POINT,
00040         LIGHT_SPOT,
00041         LIGHT_IBL,
00042         LIGHT_NONE,
00043     };

Constructor & Destructor Documentation

mudbox::Light::Light void   )  [protected]
 

Constructor. Do not use this directly. Use CreateInstances() instead.

This is the typical way to create a Light:

            Light *myLight = CreateInstance<Light>();

Member Function Documentation

virtual const mudbox::ClassDesc* mudbox::Light::RuntimeClass void   )  const [inline, virtual]
 

Reimplemented from mudbox::GroupNode.

00025 :
const mudbox::ClassDesc* mudbox::Light::StaticClass void   )  [static]
 

Reimplemented from mudbox::GroupNode.

mudbox::Node* mudbox::Light::CreateInstances unsigned int  iCount = 1  )  [static]
 

Reimplemented from mudbox::GroupNode.

virtual Color mudbox::Light::Diffuse void   )  const [virtual]
 

Returns the diffuse color value of the light.

virtual void mudbox::Light::SetDiffuse const Color cDiffuse  )  [virtual]
 

Sets the diffuse color value of the light.

Parameters:
cDiffuse  [in] The new color
virtual float mudbox::Light::Intensity void   )  const [virtual]
 

Returns the light intensity in range 0..1.

virtual void mudbox::Light::SetIntensity float  fIntensity  )  [virtual]
 

Sets the light intensity in range 0..1.

Parameters:
fIntensity  [in] The new intensity (0 is no light; 1 is full light)
virtual bool mudbox::Light::IsLockedToCamera void   )  const [virtual]
 

Returns true if the light direction is locked to the camera direction.

virtual void mudbox::Light::SetLockedToCamera bool  bOnOrOff  )  [virtual]
 

Set lock/unlock to camera.

Parameters:
bOnOrOff  [in] If true, the light will be locked to the camera so that it is always pointing in the same direction.
virtual bool mudbox::Light::Render void   )  [virtual]
 

Renders the light manipulator or light geometry, if they are turned on.

virtual Manipulator* mudbox::Light::GetManipulator  )  [virtual]
 

Returns a pointer to the light's manipulator, or NULL if no manipulator has been created.

virtual void mudbox::Light::ValidateShadowMap  )  [virtual]
 

Checks and updates the shadow map (if shadowing is turned on).

virtual Texture* mudbox::Light::ShadowDepthMap  )  [virtual]
 

Returns the depth map associated with the light.

virtual const Matrix& mudbox::Light::ShadowMatrix  )  const [virtual]
 

Returns the shadow/depth map matrix associated with light.

This matrix is the 'view matrix' of the light. It is used to render the scene from the light's perspective (and thus create a depth buffer), and to transform the main scene depth values into 'light space' so we can compare the main scene depth values to the light's scene depth values. This is used to create shadow maps for the light.

virtual bool mudbox::Light::CastShadow  )  [virtual]
 

Returns true if shadow castinging is enabled for this light.

virtual float mudbox::Light::ShadowBias  )  [virtual]
 

Returns the shadow bias for this light.

Bias does not have a fixed range, but generally lies between -1 & 1. It is used to offset the depth map either toward the light’s position or away from it. This is used to correct any inaccuracies in the depth comparison caused by precision loss. (Either when converting the pixel’s position to light space or in the depth map itself). Similar to polygon offset in OpenGL.

virtual LightType mudbox::Light::Type  )  [virtual]
 

Returns the type of this light.

Possible return values are Light::LIGHT_DIRECTIONAL, Light::LIGHT_POINT, Light::LIGHT_SPOT, Light::LIGHT_IBL, or Light::LIGHT_NONE.

virtual void mudbox::Light::SetAttenuation float   )  [virtual]
 

Sets the light attenuation value. Range is from 0-1.

This is called "Light Decay" in the UI.

virtual float mudbox::Light::Attenuation void   )  const [virtual]
 

Returns the light attenuation value.

Range is from 0-1.

This is called "Light Decay" in the UI.

virtual Matrix mudbox::Light::LockedToCameraMatrix  )  const [virtual]
 

Returns the "locked to camera" matrix.

This matrix represents the initial camera matrix (on start up or when the light is created) multiplied by the inverse of the current camera matrix and the inverse of the current light matrix. Effectively, it is the 'delta' between the camera position, and the position of a light that is locked to it. Use this to get the current world space location of a light relative to the camera.

virtual Image* mudbox::Light::HDRImage  )  const [virtual]
 

Returns the HDRI image associated with this light, if any. Returns a NULL pointer if this is not an HDRI light.

virtual const QString* mudbox::Light::HDRImageFilename  )  const [virtual]
 

mudbox::Light mudbox::Light mudbox::Light mudbox::Light mudbox::Light mudbox::Light mudbox::Light mudbox::Light mudbox::Light mudbox::Light
mudbox::Light mudbox::Light mudbox::Light mudbox::Light mudbox::Light mudbox::Light mudbox::Light mudbox::Light mudbox::Light mudbox::Light